package com.easychat.config;

import cn.hutool.core.util.StrUtil;
import lombok.Getter;
import lombok.Setter;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import org.springframework.validation.annotation.Validated;

/**
 * @author kyle.li
 * @version 1.0
 * @description: TODO
 * @date 2024/7/3 20:05
 */
@Component("appconfig")
@Getter
public class Appconfig {

    /**
     * webSocket端口
     */
    @Value("${ws.port:}")
    private Integer wsPort;
    /**
     * 文件目录
     */
    @Value("${project.folder:}")
    private String projectFolder;
    @Value("${admin.emails:}")
    private String adminEmails;

    public String getProjectFolder(){
        if (StrUtil.isNotEmpty(projectFolder) && !projectFolder.endsWith("/")){
            projectFolder = projectFolder + "/";
        }
        return projectFolder;
    }
}
